import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_background_service_ohos/flutter_background_service_ohos.dart';
import 'package:flutter_background_service_ohos/flutter_background_service_ohos_platform_interface.dart';
import 'package:flutter_background_service_ohos/flutter_background_service_ohos_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockFlutterBackgroundServiceOhosPlatform
    with MockPlatformInterfaceMixin
    implements FlutterBackgroundServiceOhosPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final FlutterBackgroundServiceOhosPlatform initialPlatform = FlutterBackgroundServiceOhosPlatform.instance;

  test('$MethodChannelFlutterBackgroundServiceOhos is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelFlutterBackgroundServiceOhos>());
  });

  test('getPlatformVersion', () async {
    FlutterBackgroundServiceOhos flutterBackgroundServiceOhosPlugin = FlutterBackgroundServiceOhos();
    MockFlutterBackgroundServiceOhosPlatform fakePlatform = MockFlutterBackgroundServiceOhosPlatform();
    FlutterBackgroundServiceOhosPlatform.instance = fakePlatform;

    expect(await flutterBackgroundServiceOhosPlugin.getPlatformVersion(), '42');
  });
}
